<div class="form-div" style="overflow:hidden;height:25px;">
<div style="float:left;">
  <form action="erp_warehouse_manage.php" name="searchForm">
    <input type="hidden" name="act" value="stock_check" />
	<img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />

	<!-- 仓库 -->
	{$lang.erp_stock_check_warehouse_name}
	<select name="warehouse_id">
		<option value="0" {if $warehouse_id eq 0}selected="selected"{/if}>{$lang.erp_stock_check_select_warehouse}</option>
		{foreach from=$warehouse_info item="warehouse"}
			<option value="{$warehouse.warehouse_id}" {if $warehouse_id eq $warehouse.warehouse_id}selected="selected"{/if}>{$warehouse.name}</option>
		{/foreach}
	</select>

    <!-- 起始日期 -->
    {$lang.erp_stock_check_search_start_date} <input size="10" type="text" name="s_date" size="15" value="{$start_date}" />
	
	<!-- 结束日期 -->
	{$lang.erp_stock_check_search_end_date} <input size="10" type="text" name="e_date" size="15" value="{$end_date}" />
	
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

<div style="float:right;">
	<img id="print_stock_check" src="images/print.gif" />
</div>

<div style="float:right; margin-right:10px;">
	<img id="export_stock_check" src="images/export.gif" />
</div>
</div>
<script language="javascript">	
$(document).ready(function(){
	
	$("#print_stock_check").css('cursor','hand');
	$("#print_stock_check").click(function(){
		var url="erp_warehouse_manage.php?act=print_stock_check&start_date={$start_date}&end_date={$end_date}";
		window.open(url);	
	});
	
	$("#export_stock_check").css('cursor','hand');
	$("#export_stock_check").click(function(){
		
		Ajax.call('erp_warehouse_manage.php?act=export_stock_check', '' , exportStockResponse, 'POST', 'JSON');
		
		function exportStockResponse(res)
		{
			if(res.error!=0)
			{
				alert(res.message);
			}
			else{
				//alert(res.url);
				window.location=res.url;	
			}
		}
	});	
	
});

</script>